package com.atguigu.exer;

import java.util.Scanner;

/**
 * @author azzn1400820029
 * @create 2021-12-12 11:06
 */
public class ArrayDemo1 {
    public static void main(String[] args) {
        Scanner scanner = null;
        int[] scores;
        int maxScore = 0;


        scanner = new Scanner(System.in);
        System.out.println("please input student number:");
        int number = scanner.nextInt();

        maxScore = 0;
        scores = new int[number];
        for (int i = 0; i < scores.length; i++) {
            scores[i] = scanner.nextInt();
            if (maxScore < scores[i]) {
                maxScore = scores[i];
            }
        }

        scanner.close();


//       check the lever as score;
        char level;
        for (int i = 0; i < scores.length; i++) {
            if (maxScore - scores[i] <= 10) {
                level = 'A';
            } else if (maxScore - scores[i] <= 20) {
                level = 'B';
            } else if (maxScore - scores[i] <= 30) {
                level = 'C';
            } else {
                level = 'D';
            }

            System.out.println("student" + i + "score is " +
                    scores[i] + ",level is " + level);

        }


    }
}
